//
//  Expression.h
//  解释器模式
//
//  Created by flannery on 2018/12/19.
//  Copyright © 2018年 flannery. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Expression : NSObject
-(BOOL)interpret:(NSString*)context;
@end

@interface TerminalExpression : Expression
-(instancetype)initWithExpression:(NSString*)data;
-(BOOL)interpret:(NSString*)context;
@end

@interface OrExpression : Expression
-(instancetype)initWithExpression1:(Expression*)expr1 expression2:(Expression*)expr2;
-(BOOL)interpret:(NSString*)context;
@end

@interface AndExpression : Expression
-(instancetype)initWithExpression1:(Expression*)expr1 expression2:(Expression*)expr2;
-(BOOL)interpret:(NSString*)context;
@end
